<?php 
$show_validator = true;
include TMPL_PATH.'public/header.phtml';
?>
<link rel="stylesheet" type="text/css" href="/statics/js/calendar/jscal2.css"/>
<link rel="stylesheet" type="text/css" href="/statics/js/calendar/win2k.css"/>
<script type="text/javascript" src="/statics/js/calendar/calendar.js"></script>
<script type="text/javascript" src="/statics/js/calendar/lang/zh-cn.js"></script>
<?php 
	if((isset($_SESSION['admin_user_info']) && $_SESSION['admin_user_info']['id'] == 1) || $action=='index') {
		$r = 1;
	}else{
		$privdb = D('admin_role_priv');
		$r = $privdb->where(array('c'=>strtolower(MODULE_NAME),'a'=>'order_list','roleid'=>$_SESSION['admin_user_info']['roleid']))->find();
	}
		
	if($r){
?>
<form action="<?php echo U('order/order_list');?>" method="post" id="myform">
<?php }else{?>
<form action="<?php echo U('orderdisplay/order_list');?>" method="post" id="myform">
<?php }?>
<div class="pad-10">
<div class="col-tab">
<div class="contentList pad-10">
<table width="100%"  class="table_form">
  <tr>
    <th width="120">订单号：</th>
    <td class="y-bg">
     <input type="text" class="input-text" name="order_sn" id="order_sn" />
	</td>
	<tr>
    <th width="120">电子邮件：</th>
    <td class="y-bg">
     <input type="text" class="input-text" name="delivery_email" id="delivery_email" />
	</td>
	</tr>
	<tr>
    <th width="120">查询方式：</th>
    <td class="y-bg">
     <input type="radio" value="0" name="select_type" onclick="productCss(0);" checked="checked" />本地 &nbsp;&nbsp;
	</td>
	</tr>
	<tr>
    <th width="120">收货人：</th>
    <td class="y-bg">
     <input type="type" class="input-text" name="delivery_name" id="delivery_name"  />
	</td>
	</tr>
	<tr>
    <th> 地址：</th>
    <td class="y-bg">
     <input type="text" class="input-text" name="delivery_address" id="delivery_address" />
	</td>
	</tr>
	<tr>
    <th> 邮编：</th>
    <td class="y-bg">
     <input type="text" class="input-text" name="delivery_postcode" id="delivery_postcode" />
	</td>
	</tr>
	<tr>
    <th> 电话：</th>
    <td class="y-bg">
     <input type="text" class="input-text" name="delivery_phone" id="delivery_phone" />
	</td>
	</tr>
	<tr>
    <th> 手机：</th>
    <td class="y-bg">
     <input type="text" class="input-text" name="delivery_mobile" id="delivery_mobile" />
	</td>
	</tr>
	<tr>
    <th> 所在地区：</th>
    <td class="y-bg">
    国家：<select name="delivery_cid"  id="select_countries" class="general_select" title="<?php echo L('choosecountry')?>">
		<option value="">请选择</option>
		<?php 
			if(isset($countryList) && $countryList):
				foreach($countryList as $country):
		?>
			<option value="<?php echo $country['id'] ?>"><?php echo $country['name'] ?></option>
		<?php 
				endforeach;
			endif;
		?>
	</select> 省：<input type="text" class="input-text" name="delivery_province" id="delivery_province" />市：<input type="text" class="input-text" name="delivery_city" id="delivery_city" />
	</td>
	</tr>
	<tr>
    <th> 配送方式：</th>
    <td class="y-bg">
	<?php if(isset($shippingList) && $shippingList): ?> 	
	  <select name="shipping_method" id="shipping_method" onchange="getshippingmoney02(this.value);" class="select-s">
	  	<option value="">请选择</option>
		<?php 
			foreach ($shippingList as $shipping):
		?>
		<option value="<?php echo $shipping['name'];?>" <?php if($orderInfo['shipping_method'] == $shipping['name'])echo 'selected';?>>&nbsp;&nbsp;<?php echo isset($shipping['title']) ? $shipping['title'] : null;?></option>
		<?php
			endforeach;
		?>
		<?php endif; ?>
	  </select>
		  
	</td>
	</tr>
	<tr>
    <th> 支付方式：</th>
    <td class="y-bg">
     	<select name="payment_method" id="payment_method" onchange="getPaymentMoney02(this.value);" class="select-s">
			<option value="">请选择</option>
			<?php
			if(isset($paymentList) && $paymentList):
				$i=1;
				foreach ($paymentList as $k => $payment) :
					if (!$payment['status']) continue;
			?>
					<option value="<?php echo isset($payment['name']) ? $payment['name'] : null ;?>" <?php if($orderInfo['payment_method'] == $payment['name'])echo 'selected';?>>&nbsp;&nbsp;<?php echo isset($payment['title']) ? $payment['title'] : null;?></option>
			<?php
					$i++;
				endforeach;
			endif;
			?>
		 </select>
	</td>
	</tr>
	<tr id="typecss">
    <th> 下单时间：</th>
    <td class="y-bg">
     <input type="text" name="start_time" id="start_time" class="input-text" />至<input class="input-text" name="end_time" id="end_time" type="text" />
	 <script type="text/javascript">
		Calendar.setup({
		weekNumbers: false,
		inputField : "start_time",
		trigger    : "start_time",
		dateFormat: "%Y-%m-%d",
		showTime: false,
		minuteStep: 1,
		onSelect   : function() {this.hide();}
		});
	</script>
	<script type="text/javascript">
		Calendar.setup({
		weekNumbers: false,
		inputField : "end_time",
		trigger    : "end_time",
		dateFormat: "%Y-%m-%d",
		showTime: false,
		minuteStep: 1,
		onSelect   : function() {this.hide();}
		});
	</script>
	</td>
	</tr>
	<tr>
    <th> 订单状态：</th>
    <td class="y-bg">
     <select name="order_status">
	 	<option value="">请选择</option>
		<?php 
			foreach (OrderModel::$orderStatusCn as $os_key => $os_val):
		?>
		<option value="<?php echo $os_key?>"><?php echo $os_val;?></option>
		<?php 
			endforeach;
		?>
	</select>
	</td>
	</tr>
	<tr>
    <th> 付款状态：</th>
    <td class="y-bg">
       <select name="payment_status">
	   		<option value="">请选择</option>
			<?php 
				foreach (OrderModel::$paymentStatus as $ps_key => $ps_val):
			?>
			<option  value="<?php echo $ps_key?>"><?php echo $ps_val;?></option>
			<?php 
				endforeach;
			?>
		</select>
	</td>
	</tr>
	<tr>
    <th> 发货状态：</th>
    <td class="y-bg">
     	<select name="shipping_status">
			<option value="">请选择</option>
			<?php 
				foreach (OrderModel::$shippingStatus as $ss_key => $ss_val):
			?>
			<option value="<?php echo $ss_key?>"><?php echo $ss_val;?></option>
			<?php 
				endforeach;
			?>
		</select>
	</td>
	</tr>
	
  </table>
</div>

<div class="bk15"></div>
<input name="dosubmit" type="submit" class="button" value="提交" class="button">
</div>
</div>
</form>
</body>
</html>
<script type="text/javascript">
function productCss(id)
{	
	$("#typecss").css('display',(id == 1) ? "none" : "");
	if(id){
		document.getElementById('myform').action = "<?php echo U('manage/new_order_list');?>";
	}else{
		<?php if($r){?>
			document.getElementById('myform').action = "<?php echo U('order/order_list');?>";
		<?php }else{?>
			document.getElementById('myform').action = "<?php echo U('orderdisplay/order_list');?>";
		<?php }?>
	}
}
</script>